#ifndef NODE_H
#define NODE_H

struct AABB;
struct WPlane;

struct bNode {
    bNode *next;
    AABB *box;

    bNode() {
        next = NULL;
        box = NULL;
    }

    bNode(bNode *n, AABB *b) {
        next = n;
        box = b;
    }

    ~bNode() {
        /*if (box)
            free(box);*/
        if (next) {
            delete next;
        }
    }

    void print(int i) {
        static int printInt = 1;

        if (i == 0) {
            printInt = 1;
            return;
        }

        printf("%*d\n", printInt, printInt);
        printInt++;
        if (next) {
            next->print(1);
        }
    }
};

struct gNode {
    gNode *next;
    WPlane *plane;

    gNode() {
        next = NULL;
        plane = NULL;
    }

    ~gNode() {
        delete next;
    }

    gNode(gNode *n, WPlane *p) {
        next = n;
        plane = p;
    }
};

#endif
